package com.feijiang.mapper;

import com.feijiang.entity.ExpeData;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author author
 * @since 2021-12-28
 */
public interface ExpeDataMapper extends BaseMapper<ExpeData> {

  @Delete("delete from tb_expe_data where expe_id = #{expeId}")
  int deleteByExpeId(@Param("expeId") int expeId);

  @Select("select * from tb_expe_data where expe_id = #{expeId} limit #{i}, #{pageSize}")
  List<ExpeData> queryByPage(@Param("pageSize") int pageSize, @Param("i") int i, @Param("expeId") int expeId);

  @Select("select * from tb_expe_data limit #{i}, #{pageSize}")
  List<ExpeData> listAllByPage(@Param("pageSize") int pageSize, @Param("i") int i);

  @Select("select * from tb_expe_data where is_checked = 0 limit #{i}, #{pageSize}")
  List<ExpeData> listUnchecked(@Param("pageSize") int pageSize, @Param("i") int i);

  @Update("update tb_expe_data set is_checked = 1 where id = #{id}")
  int checkById(@Param("id") int id);
}
